// components/swiper/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    dataList: { type: Array, value: () => ([]) }
  },

  /**
   * 组件的初始数据
   */
  data: {
    background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
    indicatorDots: true,
    vertical: false,
    autoplay: true,
    interval: 2000,
    duration: 500
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onJump(event) {
      const { id, type } = event.currentTarget.dataset;
      if(type == 3) { //  跳转页面
        wx.navigateTo({
          url: '/packageA/pages/active/detail5/index?id=' + id,
        })
      } else if( type == 1 ) { // 内部页面
        wx.navigateTo({
          url: '/packageA/pages/active/detail4/index?id=' + id,
        })
      }
    },
    changeIndicatorDots() {
      this.setData({
        indicatorDots: !this.data.indicatorDots
      })
    },
    changeAutoplay() {
      this.setData({
        autoplay: !this.data.autoplay
      })
    },
    intervalChange(e) {
      this.setData({
        interval: e.detail.value
      })
    },
    durationChange(e) {
      this.setData({
        duration: e.detail.value
      })
    }
  }
})